home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / _getdi.doc next >
Text File  |  1986-09-23  |  1KB  |  39 lines

  1.  
  2.  
  3.  
  4.         NAME
  5.                 _getdi -- get device information for file handle
  6.  
  7.         SYNOPSIS
  8.                 r = _getdi(fh);
  9.                 int r;      status byte, low 8 bits only
  10.                 int fh;     DOS file handle to investigate
  11.  
  12.  
  13.         DESCRIPTION
  14.         This function returns the lower 8 bits of the control word for
  15.         the specified file handle, usually stdout, stdin, or one of the
  16.         other standard channels.  Note that a file handle, NOT file
  17.         descriptor is required.  Refer to the DOS manual for the
  18.         description of all the bits. Bit 7 set indicates a character
  19.         device, and bits 0,1 refer to the console.  This function
  20.         is called by the functions isatty() and iscons().
  21.  
  22.  
  23.         EXAMPLE
  24.               int r;
  25.               int fh;
  26.               fh = fileno(stdout);    /* get file handle for stdout */
  27.               r = _getdi(fh);
  28.               if(r >= 0x80) printf("stdout is a character device");
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.         This function is found in SMDLx.LIB for the Datalight Compiler
  39.